//
//  XLCardsVucherModel.m
//  XiangLove
//
//  Created by 宋振 on 2018/8/29.
//  Copyright © 2018年 BAOMIHUA.COM. All rights reserved.
//

#import "XLCardsVucherModel.h"

@implementation XLCardsVucherModel

- (NSInteger)CountInteger
{
    return [NSDecimalNumber decimalNumberWithString:[NSString stringWithFormat:@"%.lf", self.Count.doubleValue]].integerValue;
}

- (NSInteger)ChatInteger
{
    return [NSDecimalNumber decimalNumberWithString:[NSString stringWithFormat:@"%.lf", self.ChatLong.doubleValue]].integerValue;
}

- (NSString *)CreateDate
{
    if (K_DEFULT(_CreateDate).length > 0) {
        
        NSArray *createDates = [_CreateDate componentsSeparatedByString:@" "];
        
        if (createDates.count > 0) {
            
            NSString *date = createDates[0];
            
            date = [date stringByReplacingOccurrencesOfString:@"-" withString:@"."];
            
            return date;
        }
        
    }
    
    return _CreateDate;
}

- (NSString *)ExpiryDate
{
    if (K_DEFULT(_ExpiryDate).length > 0) {
        
        NSArray *createDates = [_ExpiryDate componentsSeparatedByString:@" "];
        
        if (createDates.count > 0) {
            
            NSString *date = createDates[0];
            
            date = [date stringByReplacingOccurrencesOfString:@"-" withString:@"."];
            
            return date;
        }
        
    }
    
    return _ExpiryDate;
}



@end
